import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { NgZorroIopModule } from 'ng-zorro-iop';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { SharedComponentModule } from "../shared-component/shared-component.module";
import { ApplicationListComponent } from './list/application-list.component';
import { ApplicationCreateComponent } from './create/application-create.component';
import { ApplicationDetailComponent } from './detail/application-detail.component';
import { ClipboardModule } from 'ngx-clipboard';
import { FcsServiceStateGuard } from '../authentication/fcs-service-guard';

const APP_ROUTES: Routes = [
  {
    path: '',
    component: ApplicationListComponent,
    //canActivate: [FcsServiceStateGuard],
    data: {
      breadcrumb: '应用列表',
      hasRegion: true
    }
  },
  {
    path: 'detail/:id',
    component: ApplicationDetailComponent,
    //canActivate: [FcsServiceStateGuard],
    data: {
      breadcrumb: '应用详情',
      hasRegion: false
    }
  }
];

@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(APP_ROUTES),
    FormsModule,
    ReactiveFormsModule,
    NgZorroAntdModule,
    NgZorroIopModule,
    SharedComponentModule,
    ClipboardModule
  ],
  declarations: [
    ApplicationListComponent,
    ApplicationCreateComponent,
    ApplicationDetailComponent
  ],
  entryComponents: [
    ApplicationCreateComponent
  ],
  providers: [
    FcsServiceStateGuard
  ]
})
export class ApplicationModule { }
